import request from '@/utils/request';

//添加购物车商品
export const cartAdd = (params: any) => {
    return request({
        url: '/app-api/order/cart/add',
        method: 'POST',
        body: params,
        hideLoading: true,
    });
};
//查询用户的购物车列表
export const cartList = (params: any) => {
    return request({
        url: '/app-api/order/cart/list',
        method: 'GET',
        body: params,
        hideLoading: true,
    });
};
//查询用户在购物车中的商品数量
export const cartGetCount = (params: any) => {
    return request({
        url: '/app-api/order/cart/get-count',
        method: 'GET',
        body: params,
        hideLoading: true,
    });
};
//更新购物车商品选中
export const cartUpdateSelected = (params: any) => {
    return request({
        url: '/app-api/order/cart/update-selected',
        method: 'PUT',
        body: params,
        hideLoading: true,
    });
};
//更新购物车商品数量
export const cartUpdateCount = (params: any) => {
    return request({
        url: '/app-api/order/cart/update-count',
        method: 'PUT',
        body: params,
        hideLoading: true,
    });
};

//删除购物车商品
export const cartDelete = (params: any) => {
    return request({
        url: `/app-api/order/cart/delete?ids=${params}`,
        method: 'DELETE',
        hideLoading: true,
    });
};
